package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.List;

@TableName("t_role")
public class RoleBean {
    /**角色id*/
    @TableId(value = "pk_roleId" , type = IdType.AUTO)
    private Integer roleId;
    /**角色名*/
    @TableField("r_name")
    private String roleName;
    /**角色包含的权限集合*/
    @TableField(exist = false)
    private List<GradeBean> gradeList;

    public RoleBean() {
    }


    public RoleBean(String roleName) {
        this.roleName = roleName;
    }

    public RoleBean(String roleName, List<GradeBean> gradeList) {
        this.roleName = roleName;
        this.gradeList = gradeList;
    }

    public RoleBean(Integer roleId, String roleName, List<GradeBean> gradeList) {
        this.roleId = roleId;
        this.roleName = roleName;
        this.gradeList = gradeList;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public List<GradeBean> getGradeList() {
        return gradeList;
    }

    public void setGradeList(List<GradeBean> gradeList) {
        this.gradeList = gradeList;
    }

    @Override
    public String toString() {
        return "RoleBean{" +
                "roleId=" + roleId +
                ", roleName='" + roleName + '\'' +
                ", gradeList=" + gradeList +
                '}'+"\n";
    }
}
